package com.wyd.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Set;

@Data
public class DseProductPriorityInfo implements Comparable{

    /**
     * dse产品ID
     */
    private String dseProductId;
    /**
     * 网络运营商(多个)
     */
    private Set<String> plmns;
    /**
     * 实际产品可用率
     */
    private BigDecimal availability;
    /**
     * 实际产品成本
     */
    private BigDecimal cost;

    /**
     * 信号强度
     */
    private int plmnStrength;

    /**
     * 网络值
     */
    private int netType;

    /**
     * 优先级
     */
    private int priority;

    /**
     * 套餐类型：0：固定套餐 1： 固定套餐外有叠加包 2:无固定套餐
     */
    private int packageType;

    /**
     * 计算出来的分数
     */
    private int score;

    /**
     * 配置可用阈值
     */
    private int channelWeightVal;
    /**
     * 实际可用阈值
     */
    private int availablePercent;




    public DseProductPriorityInfo(){}

    public DseProductPriorityInfo(String dseProductId, int packageType,BigDecimal availability, BigDecimal cost, int plmnStrength, int netType) {
        this.dseProductId = dseProductId;
        this.packageType = packageType;
        this.availability = availability;
        this.cost = cost;
        this.plmnStrength = plmnStrength;
        this.netType = netType;
    }


    public DseProductPriorityInfo(String dseProductId, Set<String> plmns,int netType,int channelWeightVal,int availablePercent) {
        this.dseProductId = dseProductId;
        this.plmns = plmns;
        this.netType = netType;
        this.channelWeightVal = channelWeightVal;
        this.availablePercent = availablePercent;
    }

    @Override
    public int compareTo(Object o) { //先按照分数降序，之后成本升序
        DseProductPriorityInfo product = (DseProductPriorityInfo) o;
        if(this.score>product.score){
            return -1;
        }
        else if(this.score<product.score){
            return 1;
        }else{
            return 0;
        }
    }

    @Override
    public String toString() {
        return "DseProductPriorityInfo{" +
                "dseProductId='" + dseProductId + '\'' +
                ", plmns=" + plmns +
                ", availability=" + availability +
                ", cost=" + cost +
                ", plmnStrength=" + plmnStrength +
                ", netType=" + netType +
                ", priority=" + priority +
                ", score=" + score +
                ", channelWeightVal=" + channelWeightVal +
                ", availablePercent=" + availablePercent +
                '}';
    }
}
